<html>
<head><meta charset="utf-8"><title>installing clippy from extended build · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html">installing clippy from extended build</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204136193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204136193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> heftig <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204136193">(Jul 16 2020 at 20:09)</a>:</h4>
<p>I just upgraded the Arch Linux package to 1.45.0, but the build no longer installs <code>cargo-clippy</code> and <code>clippy-driver</code>. The log shows:</p>
<div class="codehilite"><pre><span></span><code>Building stage2 tool cargo-clippy (x86_64-unknown-linux-gnu)
warning: value assigned to `applicability` is never read
   --&gt; src/tools/clippy/clippy_lints/src/write.rs:284:29
    |
284 | ...                   applicability = Applicability::HasPlaceholders;
    |                       ^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_assignments)]` on by default
    = help: maybe it is overwritten before being read?

warning: unused variable: `applicability`
   --&gt; src/tools/clippy/clippy_lints/src/write.rs:284:29
    |
284 | ...                   applicability = Applicability::HasPlaceholders;
    |                       ^^^^^^^^^^^^^
    |
    = note: `#[warn(unused_variables)]` on by default
    = help: did you mean to capture by reference instead?

warning: 2 warnings emitted

    Finished release [optimized] target(s) in 0.24s
Dist clippy stage2 (x86_64-unknown-linux-gnu)
        finished in 7.765
skipping Install clippy stage2 (x86_64-unknown-linux-gnu)
</code></pre></div>


<p>Help, please?</p>



<a name="204136838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204136838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> heftig <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204136838">(Jul 16 2020 at 20:14)</a>:</h4>
<p>Oh, reading <code>bootstrap/install.rs</code>, it seems <code>build.tools</code> must now be specified? I had hoped not specifying it would result in all tools getting installed.</p>



<a name="204142329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204142329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204142329">(Jul 16 2020 at 21:01)</a>:</h4>
<p>No, this is regression.</p>
<p><span class="user-mention" data-user-id="124288">@oli</span> before <a href="https://github.com/rust-lang/rust/commit/a1824505d8ddada2598356eaeace3ae17ee5ec30#diff-81306d4a8836178cc611ca8d1fc76cddL217-L220">https://github.com/rust-lang/rust/commit/a1824505d8ddada2598356eaeace3ae17ee5ec30#diff-81306d4a8836178cc611ca8d1fc76cddL217-L220</a> Clippy was always installed when build succeed or it was specified in <code>tools</code>. Since that PR Clippy is only installed when specified in <code>tools</code> in <code>config.toml</code>.</p>



<a name="204144973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204144973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> heftig <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204144973">(Jul 16 2020 at 21:22)</a>:</h4>
<p>I guess the code should be returned to the <code>if builder.ensure(dist::Foo { ... }).is_some() || Self::should_install(builder)</code> pattern for clippy and rust-analyzer?</p>



<a name="204146633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204146633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204146633">(Jul 16 2020 at 21:38)</a>:</h4>
<p>IMO for rust-analyzer <code>if builder.ensure(dist::Foo { ... }).is_some() || Self::should_install(builder)</code> would be correct but Clippy is expected to always build if enabled so whole <code>if ... else</code> should be replaced with bare <code>install_clippy(builder, self.compiler.stage, self.target);</code></p>
<p><code>should_install()</code> makes no sense to me since <code>should_build()</code> already  controls whether the tool is built and has sane default. Why would somebody use <code>./x.py install</code> command to build tool but not install it?<br>
cc <span class="user-mention" data-user-id="116122">@simulacrum</span> for opinion on ^</p>



<a name="204146852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204146852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204146852">(Jul 16 2020 at 21:40)</a>:</h4>
<p>x.py install is basically abandoned, in the sense that I can't explain it, but what you propose seems loosely fine?</p>



<a name="204147109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204147109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204147109">(Jul 16 2020 at 21:42)</a>:</h4>
<p>Personally I'd remove all <code>should_install</code> and always install Clippy if it's enabled.</p>



<a name="204199772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/installing%20clippy%20from%20extended%20build/near/204199772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> heftig <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/installing.20clippy.20from.20extended.20build.html#204199772">(Jul 17 2020 at 12:30)</a>:</h4>
<p>An issue was filed at <a href="https://github.com/rust-lang/rust/issues/74431">https://github.com/rust-lang/rust/issues/74431</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>